package stx.com.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import stx.com.entity.TUser;
import stx.com.service.UserService;

@Controller
public class LoginController {
	@Resource
	private UserService userService;
	
	@RequestMapping("login.do")
	public String login(TUser user,HttpServletRequest request){
		if(userService.uLogin(user)){
			TUser users=userService.uCheck(user);
			request.getSession().setAttribute("users", users);
			return "writediary";
		}
			return "login";
	}
}
